<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<link rel="stylesheet" href="__STATIC__/plugins/layui/css/layui.css" media="all" />
		<link rel="stylesheet" href="__CSS__/global.css" media="all">
		<link rel="stylesheet" href="__STATIC__/plugins/font-awesome/css/font-awesome.min.css">
		<link rel="stylesheet" href="__CSS__/table.css" />
	</head>

	<body>

	<blockquote class="layui-elem-quote">
				<a href="__ADMIN__/article/add" class="layui-btn layui-btn-small">
					<i class="layui-icon">&#xe608;</i> 添加新文章
				</a>
				
			</blockquote>
		<div style="border-style: solid; border-width: 1px;border-color: #CCC">
			<h3 style="background-color: #f0ffff">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;筛选</h3>
			<br>
			<form action="__ADMIN__/article/index" method="post">
			<div class="layui-form-item">
					<label class="layui-form-label">文章id:</label>
					<div class="layui-input-block">
						<input name="id" lay-verify="title" id='id' autocomplete="off" placeholder="" value="{$id}" class="layui-input" type="text">
				  	<div id="logo_img"></div>
					</div>
				</div>
				<div class="layui-form-item">
					<label class="layui-form-label">文章名字:</label>
					<div class="layui-input-block">
						<input name="name" lay-verify="title" id='name' autocomplete="off" placeholder="" value="{$name}" class="layui-input" type="text">
				  	<div id="logo_img"></div>
					</div>
				</div>
				  <div class="layui-input-block">
					<input type="submit" class="layui-btn" value="提交">
				</div>
			</form>
		</div>
		<br>
			<fieldset class="layui-elem-field">
				<legend>数据列表</legend>
				<div class="layui-field-box">
					<table class="site-table table-hover">
						<thead>
							<tr>
								<th>ID</th>
								<th>标题</th>
								<th>图片</th>
								<th>简介</th>
								<th>发布时间</th>
								<th>操作</th>
		
							</tr>
						</thead>
						<tbody id ="tbody">					
					   {volist name="list" id="vo"}
                            <tr>
                                <td>{$vo.id}</td>
                                <td>{$vo.title}</td>
                                <td><img width="60px" src="__STATIC__/{$vo.img}"></td>
                                <td>{$vo.jianjie}</td>
                                <td>{$vo.create_time}</td>
								<td>
									<a href="__ADMIN__/article/add?id={$vo.id}" class="layui-btn layui-btn-mini">编辑</a>
									<a href="javascript:;" del="{$vo.id}" class="layui-btn layui-btn-danger layui-btn-mini del">删除</a>

								</td>
							</tr>
							{/volist}
						</tbody>
					</table>
							<div id="page"></div>
	
				</div>
			</fieldset>
	</body>

			<script type="text/javascript" src="__STATIC__/plugins/layui/layui.js"></script>
			<script type="text/javascript" src="__STATIC__/datas/nav.js"></script>	
			<script src="__JS__/index.js"></script>
		    <script src="__JS__/jquery.js"></script>

	</html>
		<script>
			layui.config({
				base: '__STATIC__/plugins/layui/modules/'
			});
			layui.use(['laypage', 'layer'], function(){
				  var laypage = layui.laypage;
				  var id = $("#id").val();
				  var nickname = $("#nickname").val();
				  var phone = $("#phone").val();
				  var level = $("#level").val();
				  var yewuy = $("#yewuy").val();
				  $(".del").click(function(){
					var obj = $(this);
					var id = $(this).attr("del");
					layer.confirm('是否确认删除', {
						btn: ['是','否'] //按钮
						}, function(){
							$.ajax({
								type:"post",
								url:"__ADMIN__/article/del",
								data:{id:id},
								dataType:"json",
								success:function(res){
							 layer.msg('删除成功', {icon: 1});
							obj.parent().parent().hide();
								}
							})
						})
				})
				    laypage.render({
					    elem: 'page'
					    ,count: {$count} //数据总数
					    ,limit:20
					    ,jump: function(obj){ }
					 
					     	})
					    }
					  );




			
		</script>